<template>
    <div class="panel_footer">
        <div>
            This blog has running : {{day}} day {{hours}} hours ~(ღゝ◡╹)ノ♡
            <br>
            <p>Copyright © 2019 <a target="_blank" href="http://www.haski.top">luo</a> All Rights Reserved.
                <br>
                <a target="_blank" :href="filing.org_url" style="text-decoration: none">{{ filing.code }}</a>
                <br>

            </p>

        </div>
    </div>
</template>

<script>
    export default {
        name: "Footer",
        data() {
            return {
                year:'',
                day: '',
                hours: '',
                filing: {
                    title: 'Luo',
                    code: '闽ICP备19019041号-1',
                    org_url: 'https://beian.miit.gov.cn/',
                }
            };

        },
        created() {
            this.getDate();
        },
        methods: {
            getDate() {
                let t1 = '2020/03/31 11:59:06';
                let dateBegin = new Date(t1);

                let dateEnd = new Date();
                let dateDiff = dateEnd.getTime() - dateBegin.getTime();
                this.day = Math.floor(dateDiff / (24 * 3600 * 1000));//计算出相差天数

                let leave1 = dateDiff % (24 * 3600 * 1000); //计算天数后剩余的毫秒数
                this.hours = Math.floor(leave1 / (3600 * 1000));//计算出小时数
            }
        }
    }


    $(function () {
        let t1 = '2020/03/31 11:59:06';
        let dateBegin = new Date(t1);
        console.log(dateBegin);

        let dateEnd = new Date();
        let dateDiff = dateEnd.getTime() - dateBegin.getTime();
        let dayDiff = Math.floor(dateDiff / (24 * 3600 * 1000));//计算出相差天数
        let leave1 = dateDiff % (24 * 3600 * 1000); //计算天数后剩余的毫秒数
        let hours = Math.floor(leave1 / (3600 * 1000));//计算出小时数

        //计算相差分钟数
        let leave2 = leave1 % (3600 * 1000); //计算小时数后剩余的毫秒数
        let minutes = Math.floor(leave2 / (60 * 1000));//计算相差分钟数

        //计算相差秒数
        let leave3 = leave2 % (60 * 1000); //计算分钟数后剩余的毫秒数
        let seconds = Math.round(leave3 / 1000);
        console.log(" 相差 " + dayDiff + "天 " + hours + "小时 " + minutes + " 分钟" + seconds + " 秒");
    })
</script>

<style scoped>
    .panel_footer {
        text-align: center;
        width: 100%;
        height: 8vw;
        background-color: #cdd1c2;
        padding-top: 2vw;

    }


</style>
